<?php /* Smarty version 2.6.26, created on 2018-07-25 14:04:13
         compiled from E:%5CWWW%5C40.125.208.171%5Cvweb/admin%5Ctemplates/index/index.html */ ?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理登录</title>
<style type="text/css">
*{ margin:0; padding:0; font-size:14px; font-family:'Microsoft Yahei';  }
body { line-height: 1.5; height:99%; margin:0; padding:5px; background:#f8f8f8; } 
html.addbg,html.addbg body{ background:#e2e9ea }
h1, h2, h3, h4, h5, h6 {font-size:100%;}
ol, ul, li, dl, dd, dt {list-style:none;}
a{ color: #666666; font-size:12px;  text-decoration:none; } 
a:hover{ color:#F60; text-decoration:underline; text-decoration:none; } 
::-webkit-input-placeholder { color:#999; }
:-moz-placeholder{color:#999; }
::-moz-placeholder{color:#999; }
:-ms-input-placeholder{color:#999; } 
.logo{ width:355px; text-align:center; padding:0; font-size:36px; font-weight:bold; text-align:center; color:#1693E2;  float:left; } 
.login{ width:380px; height:180px; padding:10px 0 20px 0; margin:100px auto 0 auto; }
.loginBox{ width:380px; border-radius:3px; padding:15px 0 38px; float:left;} 
.loginBox dl{ width:380px; padding:6px 0; float:left;} 
.loginBox dl dd{ margin:0 0 0 30px; width:300px; border-radius:3px; background:#fff; margin-bottom:2px; border:1px solid #ddd; float:left;}
.loginBox dl dd span{ width:53px; padding:12px 10px 10px 0; background:#ECEFF1; border-right:1px solid #E6E8EA; text-align:right; color:#333; float:left; }
.code{ padding:0 0 0 5px; }
a.vcode_box{ border-left:none; padding:0; float:right; } 
.login_input{ width:220px; border:none; padding:12px 8px; background:#F8FBFD; color:#333; -webkit-appearance: none; float:left; } 
.login_input2{ width:176px; padding:12px 8px 11px; border:none; background:#F8FBFD; color:#0772B3; float: left; }
.login_submit{ width:302px; border:1px solid #2293DA; height:40px; color:#DEF6FB; border-radius:3px; padding:0 8px; background:#2B9CE3; float:left; }
#vcode_img{ padding:3px 0 3px 3px; float:left;} 
.bq{ width:380px; margin:20px auto 0 auto; color:#0D829D; text-align:center; font-size:12px;} 
</style> 
</head>
<body>
<form action="#" method="post"> 
	<div class="login"> 
		<div class="logo">系统管理</div>
		<div class="loginBox">
			<dl>
				<dd>
					<span>用户名</span>
					<input type="text" class="login_input" id="username" size="30" name="username" placeholder="请输入用户名"/>
				</dd>
			</dl>
			<dl>
				<dd>
					<span>密&nbsp;&nbsp;&nbsp;码</span>
					<input type="password" class="login_input" id="password" size="30" name="password" placeholder="请输入密码">
				</dd>
			</dl> 
			<dl>
				<dd>
					<input type="text" class="login_input2" id="vcode" size="12" name="vcode" placeholder="验证码">
					<a href="javascript:;" onClick="change_img()" class="vcode_box"><img id="vcode_img"/></a> 
				</dd>
			</dl> 
			<dl><dd style="border:none;"><input type="submit" class="login_submit" name="submit" value="登 录"/></dd></dl> 
			<dl><div style="text-align:center; color:#888; font-size:12px;">商网通系统</div></dl> 
		</div> 
	</div>  
</form>	
</body>
</html>
<script type="text/javascript" src="<?php echo $this->_tpl_vars['__PUBLIC__']; ?>
js/jquery.min.js"></script> 
<script type="text/javascript"> 
function change_img(){ 
	var timestamp = (new Date()).valueOf();
	var src = '?m=index&a=vcode&color=blank&time='+timestamp;
	$("#vcode_img").attr('src',src);
} 
change_img();
$(function(){
	$('form').submit(function(){
		var username = $('#username').val();
		var password = $('#password').val();
		var vcode = $('#vcode').val(); 
		$.ajax({
			type:'POST',
			url:'?a=login_submit',
			data:{username:username, password:password, vcode:vcode}, 
			success:function(result){ 
				var data = jQuery.parseJSON(result); 
				if(data.error == '0'){
					location.href="?a=login";
				}else{
					alert(data.msg);
					change_img();
				}
			},
			error:function(){
				alert('错误');
			}
		});
		return false;
	}); 
});

</script>